Hi SJH,
That doesn't make sense to me either. Those should be initialized to
zero on power up boot - although they don't really need to be
initialized until the Coordinated Motion Buffer is opened and then
Executed.
CoordSystem0 is a pointer to the segments to execute. If that is NULL
then no Coordinated Motion will occur.
I'd suggest you print those immediately after power up and then at
various points to see what in your code is affecting them.
Regards
TK
On 2017-10-30 17:11, Hardy Family hardy.woodland.cypress@...
[DynoMotion] wrote:
> Hi Tom,
>
> We're still having a few problems with jog shuttle. It's probably my
> misunderstanding something, but it looks like the CS0_ variables are
> not getting initialized the way I would expect. This is a function I
> use to print out the values:
>
> void print_cs0(const char * heading)
> {
> WaitNextTimeSlice();
> printf("CS0 state: %s\n", heading);
> printf(" t=%f TimeExecuted=%f TimeDownloaded=%f TimeLost=%f
> ToGo=%fus\n", CS0_t, CS0_TimeExecuted, CS0_TimeDownloaded,
> CS0_TimeLost,
> 1E6*(CS0_TimeDownloaded - (CS0_t + CS0_TimeExecuted)));
> printf(" TimeBase=%fus TimeBaseDelta=%fus DecelTime=%fus
> TimeBaseDesired=%fus\n",
> CS0_TimeBase*1E6, CS0_TimeBaseDelta*1E6,
> CS0_DecelTime*1E6, CS0_TimeBaseDesired*1E6);
> printf(" DoingRapid=%d Flushed=%d HoldAtEnd=%d
> NomDecel2TB2=%f\n", (int)CS0_DoingRapid, (int)CS0_Flushed,
> (int)CS0_HoldAtEnd, CS0_NomDecel2TB2);
> printf(" StoppingState=%d LastFRO=%f LastRapidFRO=%f\n",
> CS0_StoppingState, CS0_LastFRO, CS0_LastRapidFRO);
> }
>
> After rebooting the kflop, connecting, homing the machine
> (uncoordinated motion), and initializing jog shuttle mode (but never
> running any coordinated motion) it prints the following:
>
> + 99 k: CS0 state: shuttle_init (start)
> + 0 k: t=3.367286 TimeExecuted=0.126250 TimeDownloaded=5.718412
> TimeLost=0.000000 ToGo=2224876.349456us
> + 0 k: TimeBase=90.000001us TimeBaseDelta=0.041021us
> DecelTime=1000000.000000us TimeBaseDesired=90.000000us
> + 0 k: DoingRapid=1 Flushed=0 HoldAtEnd=0
> NomDecel2TB2=12188868.000000
> + 95 k: StoppingState=0 LastFRO=1.000000 LastRapidFRO=1.000000
>
> What I don't understand is where the 2nd line info came from: why is
> there 5.7 sec of downloaded segments? Why is t about 3.4 seconds into
> that? Note that the machine is not moving at all, and yet I would
> think that if FROs are 1, then it would be moving.
>
> Anyway, I hope you can provide some insight. This is a very useful
> function, but we can't yet release it to customers because the machine
> moves unexpectedly in shuttle mode. (If we get the above situation
> when entering jog shuttle mode, when the interpreter sends some real
> coordinated motion, it moves forward along the path when it really
> shouldn't).
>
> We are running firmware 433q.
>
> Regards,
> SJH
>
> On Mon, Dec 19, 2016 at 10:26 AM, Hardy Family
> <hardy.woodland.cypress@...> wrote:
>
>> Yes, that helped, thanks.
>>
>> The problem with rapid stop was because my feedback loop got started
>> immediately after shuttle_init(), and if you look at the code it is
>> now obvious that it would have been using a zero decel time in the
>> first call to SetFROwRateTemp(). That was pretty dumb. (I think I
>> might have been experimenting when first getting it to work and left
>> in the bad call - I just replaced it with SetFROTemp() and let it
>> compute the decel time.)
>>
>> The creeping motion was solved by explicitly setting FRO to 0 on
>> disable, as you suggested. I think you are right in that there was
>> some dither, and now that I am aware of it I can actually hear it on
>> the machine. It's probably because I use the sqrt function when
>> calculating the desired FRO, but that gives a larger gain near the
>> setpoint. Combined with the 90us discretization, it causes dither.
>> Maybe I can add some deadband. Without the sqrt it seemed a bit
>> sluggish to respond, but I think now that I should experiment with
>> the other parameters and probably get a better result.
>>
>> Regarding the combination of feed hold and shuttle, well that was my
>> backup plan, to disable FH when in shuttle mode. However, I was
>> fond of the ability to control FH independently, since it was useful
>> to be able to stop the machine using either function, but not
>> unexpectedly restart feed when terminating shuttle mode. Our
>> application has separate status indicator for both states, and as a
>> general rule I like all control functions to be as orthogonal as
>> possible.
>>
>> Regards,
>> SJH
>>
>> On Sun, Dec 18, 2016 at 5:46 PM, Tom Kerekes tk@...
>> [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
>>
>> Hi SJH,
>>
>> I think the crux of the issue is that KFLOP basically ignores
>> SetFRO() calls while in a FeedHold Condition. It just saves the new
>> FRO setting in CS0_LastFRO to be set later when FeedHold is
>> released. So for example in your shuttle terminate call of:
>>
>> SetFRO(CS0_LastFRO);
>>
>> it does nothing while in Feed Hold.
>>
>> The "Temporary" FRO calls do affect the desired Time Base while in
>> feedhold. I suspect the shuttle_fb_loop() called SetFROwRateTemp()
>> with a small negative value at some point before your shuttle
>> termination. Your feedback code may have a small dither around
>> setpoint issue.
>>
>> It isn't clear to me why you would allow the User to select Feedhold
>> while in shuttle mode. Or why you would want shuttle motion while
>> the user is requesting Feedhold.
>>
>> But in your current scheme of things one solution might be to call
>> SetFROwRateTemp() with a zero value in your shuttle termination.
>> Followed by the call to SetFRO(CS0_LastFRO); In that case if
>> currently in FeedHold, the motion should remain stopped (and resume
>> to CS0_LastFRO when FeedHold is released). Or if not in FeedHold,
>> it will immediately continue at CS0_LastFRO;
>>
>> On a side topic I see DecelTime=0.000001. 1us is the minimum
>> allowed Deceleration time basically to avoid divides by zero. The
>> Deceleration times are computed based on the Axes Velocities,
>> Accelerations, and Jerks of all the axes defined in the Coordinate
>> System. Could you be attempting to set the FRO when no axes are
>> defined to be in the Coordinate System? Or all the Velocities are
>> Zero?
>>
>> It isn't clear why SetFROwRateTemp(0., 0.3); gives an abrupt stop.
>> The simple code KFLOP uses is shown below. Please try again an
>> print the two variables to see if they are being set properly.
>>
>> // change from current to the specified FRO (FRO=1.0=Realtime)
>> // using a rate based on caller specified time to change from 1.0 to
>> 0.0
>>
>> void SetFROwRateTemp(float FRO, float DecelTime)
>> {
>> if (DecelTime < 1e-6)DecelTime=1e-6;
>> CS0_TimeBaseDelta = TIMEBASE*TIMEBASE/DecelTime;
>> CS0_TimeBaseDesired = FRO * TIMEBASE;
>> }
>>
>> HTH
>>
>> Regards
>>
>> TK
>>
>> On 12/17/2016 12:51 PM, Hardy Family
>> hardy.woodland.cypress@... [DynoMotion] wrote:
>>
>> PS: when exiting shuttle mode, I set the FROs to CS0_LastFRO which
>> is 0.25 in this case.
>>
>> On Sat, Dec 17, 2016 at 12:49 PM, Hardy Family
>> <hardy.woodland.cypress@...> wrote:
>>
>> I added a function which prints out all the CS0_ state.
>>
>> Sequence of events: there is a main loop running in thread 7 which
>> is responsible for handling the MPG controls. When the user
>> application enters/exits jog shuttle mode, it runs a small program
>> in thread 1 to set some bits in shared memory that the main loop can
>> access. When the "enable shuttle" bit is first set, then it runs
>> shuttle_init(). When the bit is cleared, it runs
>> shuttle_terminate(). When enabled, it calls the control loop
>> shuttle_fb_loop() every tick. When the user rotates the shuttle
>> wheel, it calls jog_shuttle() with each increment.
>>
>> Here is the console log when I am running some g-code, start jog
>> shuttle mode, press feed-hold, shuttle the program slightly, then
>> exit shuttle mode. Result is that program creeps forward very
>> slowly (actually, I think it's backwards because the time base is
>> left negative).
>>
>> I print the CS0 states at the start and end of the shuttle_init()
>> and shuttle_terminate() functions.
>>
>> I have my FRO set to 25% which is why the time base starts at
>> 22.5us. No qualitative difference is observed with normal 100% rate
>> etc.
>>
>> Turning on shuttle mode while program running (axes in motion):
>>
>> + 0 k: CS0 state: shuttle_init (start)
>> + 0 k: t=0.390783 TimeExecuted=31.024153
>> TimeDownloaded=33.642973 TimeLost=0.000000
>> + 0 k: TimeBase=22.500000us TimeBaseDelta=0.041021us
>> DecelTime=0.000001 TimeBaseDesired=22.500000us
>> + 0 k: DoingRapid=0 Flushed=0 HoldAtEnd=0
>> NomDecel2TB2=12188868.000000
>> + 0 k: StoppingState=0 LastFRO=0.250000 LastRapidFRO=1.000000
>> + 0 k: MPG shuttle mode started exec= 31.024 t= 0.392
>> lost= 0.000
>> + 0 k: CS0 state: shuttle_init (end)
>> + 0 k: t=0.392440 TimeExecuted=31.024153
>> TimeDownloaded=33.642973 TimeLost=0.000000
>> + 0 k: TimeBase=21.105285us TimeBaseDelta=0.041021us
>> DecelTime=0.000001 TimeBaseDesired=0.000000us
>> + 0 k: DoingRapid=0 Flushed=0 HoldAtEnd=0
>> NomDecel2TB2=12188868.000000
>> + 0 k: StoppingState=0 LastFRO=0.250000 LastRapidFRO=1.000000
>> + 0 k: MPG jog enabled for 0x20 map_rotary=0 shuttle=1
>>
>> this message when turning the shuttle wheel:
>>
>> + 411 k: MPG shuttle mode unlocked exec= 31.024 t=
>> 0.394 lost= 0.000
>>
>> turning off shuttle mode:
>>
>> + 87 k: CS0 state: shuttle_terminate (start)
>> + 0 k: t=0.403802 TimeExecuted=31.024153
>> TimeDownloaded=33.642973 TimeLost=0.000000
>> + 0 k: TimeBase=-0.132272us TimeBaseDelta=36.742346us
>> DecelTime=0.000001 TimeBaseDesired=-0.132272us
>> + 0 k: DoingRapid=0 Flushed=0 HoldAtEnd=0
>> NomDecel2TB2=12188868.000000
>> + 0 k: StoppingState=3 LastFRO=0.250000 LastRapidFRO=1.000000
>> + 0 k: MPG shuttle mode terminated
>> + 0 k: CS0 state: shuttle_terminate (end)
>> + 0 k: t=0.403794 TimeExecuted=31.024153
>> TimeDownloaded=33.642973 TimeLost=0.000000
>> + 0 k: TimeBase=-0.132272us TimeBaseDelta=0.041021us
>> DecelTime=0.000001 TimeBaseDesired=-0.132272us
>> + 0 k: DoingRapid=0 Flushed=0 HoldAtEnd=0
>> NomDecel2TB2=12188868.000000
>> + 0 k: StoppingState=3 LastFRO=0.250000 LastRapidFRO=1.000000
>>
>> Note that CS0_TimeBase[Desired] seems to be left at a small negative
>> value, whether I shuttle forward or back. Maybe I should look at
>> StoppingState and force TimeBase to 0 based on that?
>>
>> If I do all of the above except that I do not actually rotate the
>> shuttle control, then it remembers the feed hold exactly and does
>> not creep forward. Also, CS0_StoppingState will be at 1 instead of
>> 3.
>>
>> Here is the log (at shuttle termination) for that case:
>>
>> + 0 k: CS0 state: shuttle_terminate (start)
>> + 1 k: t=0.000268 TimeExecuted=32.495906
>> TimeDownloaded=33.996697 TimeLost=0.000000
>> + 0 k: TimeBase=0.000000us TimeBaseDelta=8100.000020us
>> DecelTime=0.000001 TimeBaseDesired=0.000000us
>> + 0 k: DoingRapid=0 Flushed=0 HoldAtEnd=0
>> NomDecel2TB2=12188868.000000
>> + 0 k: StoppingState=1 LastFRO=0.250000 LastRapidFRO=1.000000
>> + 0 k: MPG shuttle mode terminated
>> + 0 k: CS0 state: shuttle_terminate (end)
>> + 0 k: t=0.000268 TimeExecuted=32.495906
>> TimeDownloaded=33.996697 TimeLost=0.000000
>> + 0 k: TimeBase=0.000000us TimeBaseDelta=0.041021us
>> DecelTime=0.000001 TimeBaseDesired=0.000000us
>> + 0 k: DoingRapid=0 Flushed=0 HoldAtEnd=0
>> NomDecel2TB2=12188868.000000
>> + 0 k: StoppingState=1 LastFRO=0.250000 LastRapidFRO=1.000000
>>
>> Rotating the shuttle control will call SetFROwRateTemp() in the
>> control loop. It seems that having a call to that function will
>> change the StoppingState from 1 to 3. That's the only obvious
>> difference I can see, along with TimeBase being set to exactly 0.
>>
>> Finally, regarding point (1) in the original message of this thread:
>> whatever I do, I seem to get an instant stop. I replaced the
>> SetFROTemp(0.);
>> with
>> SetFROwRateTemp(0., 0.3);
>>
>> but it still screeches to a halt. In the first console log snippet
>> above, you can see that the time base starts at 22.5 and ends at
>> 21.105. The delta is 0.041. Thus, it appears that exactly 34
>> increments have been applied. That's a bit surprising to me, but I
>> guess the printfs could have caused a long delay.
>>
>> Regards,
>>
>> SJH
>>
>> On Wed, Dec 14, 2016 at 3:55 PM, Tom Kerekes tk@...
>> [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
>>
>> Hi SJH,
>>
>> Sorry I missed that.
>>
>> I don't see anything obviously wrong. Please print out the FRO
>> values that you are setting on termination as well as all the
>> CS0_xxxx variables so we can understand what went wrong. Also the
>> CS0_xxx variables when the system is in the 1/100th speed mode?
>>
>> I also am having a hard time understanding your overall sequence of
>> events.
>>
>> Regards
>>
>> TK
>>
>> On 12/14/2016 2:56 PM, Hardy Family hardy.woodland.cypress@...
>> [DynoMotion] wrote:
>>
>> So any insight regarding this issue? I added some info in message 3
>> of this thread, but not sure whether it got through.
>>
>> Regards,
>> SJH
>
>
>
> Links:
> ------
> [1]
> https://groups.yahoo.com/neo/groups/DynoMotion/conversations/messages/15116;_ylc=X3oDMTJyaW91ZTQwBF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRtc2dJZAMxNTExNgRzZWMDZnRyBHNsawNycGx5BHN0aW1lAzE1MDk0MDg3MTM-?act=reply&messageNum=15116
> [2]
> https://groups.yahoo.com/neo/groups/DynoMotion/conversations/newtopic;_ylc=X3oDMTJmY2FwdGRtBF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDZnRyBHNsawNudHBjBHN0aW1lAzE1MDk0MDg3MTM-
> [3]
> https://groups.yahoo.com/neo/groups/DynoMotion/conversations/topics/14250;_ylc=X3oDMTM3YjI4ODV0BF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRtc2dJZAMxNTExNgRzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzE1MDk0MDg3MTMEdHBjSWQDMTQyNTA-
> [4] https://yho.com/1wwmgg
> [5]
> https://groups.yahoo.com/neo/groups/DynoMotion/info;_ylc=X3oDMTJmNnJhNnRkBF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzE1MDk0MDg3MTM-
> [6]
> https://groups.yahoo.com/neo/groups/DynoMotion/members/all;_ylc=X3oDMTJnbDI4MGFmBF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDdnRsBHNsawN2bWJycwRzdGltZQMxNTA5NDA4NzEz
> [7]
> https://groups.yahoo.com/neo;_ylc=X3oDMTJlcmk4Z29tBF9TAzk3NDc2NTkwBGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTUwOTQwODcxMw--
> [8] https://info.yahoo.com/privacy/us/yahoo/groups/details.html
> [9] https://info.yahoo.com/legal/us/yahoo/utos/terms/
|
|